<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .container{
            margin-top: 80px;
            text-align: center;
            width: 310px;
        }
        #btn{
            width: 280px;

        }
    </style>
</head>
<body>
<div class="container box1" >
    <h2><a id="click">登录</a></h2>
    <form id="login_form">
        <!-- 存放一行 -->
        <div class="input-group">
            <span class="input-group-addon">Name：</span>
            <!--form-control 输入框占一整行 placeholder内容提示 -->
            <input type="text" class="form-control" placeholder="请输入账号" id="userName">
        </div>
        <br>
        <div class="input-group">
            <span class="input-group-addon">Pwd&nbsp;&nbsp;：</span>
            <!--form-control 输入框占一整行 placeholder内容提示 -->
            <input type="text" class="form-control" placeholder="请输入密码" id="userPwd">
        </div>
        <br>
        <button id="btn" type="button" class="btn btn-success">
            登录
        </button>

    </form>
</div>

<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>

    $(document).ready(function(){
        $("#btn").on("click",function () {
            $.ajax({
                type:'post',
                url:'',
                data:'',
                success:function (data) {
                    if(data==true){
                        window.location.href="index.ftl";
                    }else {
                        alert("账号或密码错误！");
                    }
                }
            })
        })
    })

</script>
</body>
</html>